package sc.tool.sqlgen.branchinfo.pfs.stringpro;

import java.util.List;

public class ProcessOmitProcessor implements StringProcessor {

    public ProcessOmitProcessor(String omit) {
        super();
        this.omit = omit;
    }

    String omit;

    @Override
    public String process(String name, List<StringProcessor> processors) {
        if (name.endsWith(omit)) {
            processors.add(new AddToEndProcessor(omit));
            return name.substring(0, name.length() - omit.length());
        }
        return name;
    }
}
